package com.cgc.shop.service.impl;

import org.springframework.stereotype.Service;

import com.cgc.shop.model.User;
import com.cgc.shop.service.UserService;
@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<User> implements UserService {

	@Override
	public User getByLoginNameAndPass(User user) {
		String hql = "from User u where u.loginName=:loginName and u.pass=:pass";
		return (User) getSession().createQuery(hql)
				.setString("loginName", user.getLoginName())
				.setString("pass", user.getPass())
				.uniqueResult();
	}

}
